#pragma once

#include <AVUIStyle.h>
#include <AVUIControlTemplate.h>
#include <AVUIResourcesChangeInfo.h>
#include <AVUIFrameworkObject.h>

namespace AVUI {

class DependencyPropertyMetadata;
class DependencyProperty;
class DependencyPropertyChangedEventArgs;
class Trigger;
class MultiTrigger;
class EventTrigger;
class DataTrigger;
class MultiDataTrigger;
class HybridDictionary;
typedef TArray< TRefCountedPtr<HybridDictionary> > HybridDictionaryArray;
class FrameworkObject;
class FrameworkContentElement;
class BindingValueChangedEventArgs;
typedef ItemStructList< TRefCountedPtr<TriggerBase> > TriggerBaseList;
typedef ItemStructList<DeferredAction> DeferredActionList;
class FrugalMap;
class FrameworkElementFactory;

class TriggerActionList : public ItemStructList< TRefCountedPtr<TriggerAction> > 
{
public:
    DECLARE_ELEMENT(TriggerActionList, Object);
};


class InstanceStyleData
{
public:
    enum Enum
    {
        InstanceValues,
        ArraySize
    };
};

class InstanceValueKey : public Object
{
public:
    DECLARE_ELEMENT(InstanceValueKey, Object);

    InstanceValueKey(int childIndex, int dpIndex, int index) : m_childIndex(childIndex), m_dpIndex(dpIndex), m_index(index) { };
    virtual bool Equals(const Object* pO) const AVUI_OVERRIDE 
    {
        InstanceValueKey* pKey = (InstanceValueKey*) object_cast<InstanceValueKey>(pO);
        if (pKey == NULL)
        {
            return false;
        }
        return m_childIndex == pKey->m_childIndex && m_dpIndex == pKey->m_dpIndex && m_index == pKey->m_index;
    }

private:
    int m_childIndex;
    int m_dpIndex;
    int m_index;
};

class StyleHelper
{
public:
    static bool ShouldGetValueFromStyle(DependencyProperty* pDP);
    static bool ShouldGetValueFromTemplate(DependencyProperty* pDP);
    static bool ShouldGetValueFromThemeStyle(DependencyProperty* pDP);
    static void SortResourceDependents(ItemStructList<ChildPropertyDependent>* pResourceDependents);
    static void AddDataTriggerWithAction(TriggerBase* pTriggerBase, BindingBase* pBinding, TRefCountedPtr<HybridDictionary>* ppDataTriggersWithActions);

    static void AddEventDependent(int childIndex, EventHandlersStore* pEventHandlersStore, ItemStructList<ChildEventDependent>* pEventDependents);

    static bool GetValueFromStyleOrTemplate(FrameworkObject fo, DependencyProperty* pDP, EffectiveValueEntry* pEntry);

    static Object* GetChildValue(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, int childIndex, FrameworkObject child, DependencyProperty* pDP, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, EffectiveValueEntry* pEntry, ValueLookupType::Enum* pSourceType, FrameworkElementFactory* pTemplateRoot);
    static Object* GetChildValueHelper(UncommonField<HybridDictionaryArray>* pDataField, ItemStructList<ChildValueLookup>* pValueLookupList, DependencyProperty* pDP, DependencyObject* pContainer, FrameworkObject child, int childIndex, bool styleLookup, EffectiveValueEntry* pEntry, ValueLookupType::Enum* pSourceType, FrameworkElementFactory* pTemplateRoot);
    static void AddContainerDependent(DependencyProperty* pDP, bool fromVisualTrigger, ItemStructList<ContainerDependent>* pContainerDependents);
    static void AddPropertyDependent(int childIndex, DependencyProperty* pDP, ItemStructList<ChildPropertyDependent>* pPropertyDependents);
    static void UpdateTables(PropertyValue* pPropertyValue, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, ItemStructList< ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, ItemStructList<ChildPropertyDependent>* pResourceDependents, TRefCountedPtr<HybridDictionary>* pDataTriggerRecordFromBinding, HybridDictionary* pChildIndexFromChildName, bool* pHasInstanceValues);

    static void OnTriggerSourcePropertyInvalidated(Style* pOwnerStyle, FrameworkTemplate* pFrameworkTemplate, DependencyObject* pContainer, DependencyProperty* pDP, DependencyPropertyChangedEventArgs* pChangedArgs, bool invalidateOnlyContainer, ItemStructList<ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, FrugalMap* pPropertyTriggersWithActions, int sourceChildIndex);

    static void InvalidateDependents(Style* pOwnerStyle, FrameworkTemplate* pFrameworkTemplate, DependencyObject* pContainer, DependencyProperty* pDP, ItemStructList<ChildPropertyDependent>* pDependents, bool invalidateOnlyContainer);
    static void InvokePropertyTriggerActions(TriggerBase* pTriggerBase, DependencyObject* pTriggerContainer, DependencyProperty* pChangedProperty, DependencyPropertyChangedEventArgs* e, int sourceChildIndex, Style* pStyle, FrameworkTemplate* pTemplate);

    static void EvaluateOldNewStates(Trigger* pTrigger, DependencyObject* pTriggerContainer, DependencyProperty* pChangedProperty, DependencyPropertyChangedEventArgs* e, int sourceChildIndex, Style* pStyle, FrameworkTemplate* pTemplate, bool* pOldState, bool* pNewState);
    static void EvaluateOldNewStates(MultiTrigger* pTrigger, DependencyObject* pTriggerContainer, DependencyProperty* pChangedProperty, DependencyPropertyChangedEventArgs* e, int sourceChildIndex, Style* pStyle, FrameworkTemplate* pTemplate, bool* pOldState, bool* pNewState);
    static void EvaluateOldNewStates(DataTrigger* pDataTrigger, DependencyObject* pTriggerContainer, BindingBase* pBinding, BindingValueChangedEventArgs* pBindingChangedArgs, UncommonField<HybridDictionaryArray>* pDataField, Style* pStyle, FrameworkTemplate* pFrameworkTemplate, bool* pOldState, bool* pNewState);
    static void EvaluateOldNewStates(MultiDataTrigger* pDataTrigger, DependencyObject* pTriggerContainer, BindingBase* pBinding, BindingValueChangedEventArgs* pBindingChangedArgs, UncommonField<HybridDictionaryArray>* pDataField, Style* pStyle, FrameworkTemplate* pFrameworkTemplate, bool* pOldState, bool* pNewState);

    static void InvokeEnterOrExitActions(TriggerBase* pTriggerBase, bool oldState, bool newState, DependencyObject* pTriggerContainer, Style* pStyle, FrameworkTemplate* pFrameworkTemplate);
    static void InvokeActions(TriggerActionCollection* pActions, TriggerBase* pTriggerBase, DependencyObject* pTriggerContainer, Style* pStyle, FrameworkTemplate* pFrameworkTemplate);
    static void InvokeActions(TriggerBase* pTriggerBase, DependencyObject* pTriggerContainer, TriggerActionCollection* pActions, Style* pStyle, FrameworkTemplate* pFrameworkTemplate);

    static void DoStyleInvalidations(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldStyle, Style* pNewStyle);
    static void InvalidateContainerDependents(DependencyObject* pContainer, ItemStructList<ContainerDependent>* pExclusionContainerDependents, ItemStructList<ContainerDependent>* pOldContainerDependents, ItemStructList<ContainerDependent>* pNewContainerDependents);
    static TRefCountedPtr<Object> GetInstanceValue(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, FrameworkElement* pFEChild, FrameworkContentElement* pFCEChild, int childIndex, DependencyProperty* pDP, int i, EffectiveValueEntry* pEntry);


    static void AddDelegateToFireTrigger(RoutedEvent* pRoutedEvent, int childIndex, ItemStructList<ChildEventDependent>* pEventDependents, TRefCountedPtr<EventHandlersStore>* ppEventHandlersStore);
    static void AddDelegateToFireTrigger(RoutedEvent* pRoutedEvent, int childIndex, FrameworkElementFactory* pTemplateRoot, FrameworkElementFactory* pChildFef, ItemStructList<ChildEventDependent>* pEventDependents, TRefCountedPtr<EventHandlersStore>* ppEventHandlersStore);
    static void InvokeEventTriggerActions(UIElement* pUIElement, Style* pStyle, RoutedEvent* pEvent);
    static void ExecuteEventTriggerActionsOnContainer(Object* pSender, RoutedEventArgs* pArgs);
    static void ExecuteEventTriggerActionsOnChild(Object* pSender, RoutedEventArgs* pArgs);

    static void ApplyTemplatedParentValue(DependencyObject* pContainer, FrameworkObject child, int childIndex, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, DependencyProperty* pDP, FrameworkElementFactory* pTemplateRoot);

    static TRefCountedPtr<Expression> GetExpression(DependencyObject* pTarget, DependencyProperty* pDP);
    static TRefCountedPtr<Expression> GetExpressionCore(DependencyObject* pTarget, DependencyProperty* pDP, PropertyMetadata* pMetadata);
    static void ExecuteOnApplyEnterExitActions(FrameworkElement* pFE, FrameworkContentElement* pFCE, FrameworkTemplate* pFT);
    static void ExecuteOnApplyEnterExitActions(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pStyle, UncommonField<HybridDictionaryArray>* pDataField);
    static void ExecuteOnApplyEnterExitActionsLoop(DependencyObject* pTriggerContainer, TriggerCollection* pTriggers, Style* pStyle, FrameworkTemplate* pTemplate, UncommonField<HybridDictionaryArray>* pDataField);
    static bool NoSourceNameInTrigger(TriggerBase* pTriggerBase);
    static TArrayPtr<RoutedEventHandlerInfo> GetChildRoutedEventHandlers(int childIndex, RoutedEvent* pRoutedEvent, ItemStructList<ChildEventDependent>* pEventDependents);
    static Object* FindNameInTemplateContent(DependencyObject* pContainer, String* pChildName, FrameworkTemplate* pFrameworkTemplate);

    static void InvalidateResourceDependents(DependencyObject* pContainer, ResourcesChangeInfo info, ItemStructList<ChildPropertyDependent>* pResourceDependents, bool invalidateVisualTreeToo) { };
    static void InvalidateResourceDependentsForChild(DependencyObject* pContainer, DependencyObject* pChild, int childIndex, ResourcesChangeInfo info, FrameworkTemplate* pParentTemplate) { };
    static Style* GetThemeStyle(FrameworkElement* pFe, FrameworkContentElement* pFce);
    static void InvokeDeferredActions(DependencyObject* pTriggerContainer, FrameworkTemplate* pFrameworkTemplate);
    static bool GetValueFromTemplatedParent(DependencyObject* pContainer, int childIndex, FrameworkObject child, DependencyProperty* pDP, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, FrameworkElementFactory* pTemplateRoot, EffectiveValueEntry* pEntry);
    static void UpdateStyleCache(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldStyle, Style* pNewStyle, TRefCountedPtr<Style>* ppStyleCache);
    static void UpdateThemeStyleCache(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldThemeStyle, Style* pNewThemeStyle, TRefCountedPtr<Style>* ppThemeStyleCache);
    static void InvalidatePropertiesOnTemplateNode(DependencyObject* pContainer, FrameworkObject child, int childIndex, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, bool isDetach, FrameworkElementFactory* pTemplateRoot);
    static FrameworkElementFactory* FindFEF(FrameworkElementFactory* pRoot, int childIndex) { return NULL; }
    static void SealIfSealable(Object* pValue);

    static void CleanupStaticAllocations();
    static TRefCountedPtr<Object> GetDataTriggerValue(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, BindingBase* pBinding);

    static void OnBindingValueInStyleChanged(Object* pSender, BindingValueChangedEventArgs* e);
    static void OnBindingValueInTemplateChanged(Object* pSender, BindingValueChangedEventArgs* e);
    static void OnBindingValueInThemeStyleChanged(Object* pSender, BindingValueChangedEventArgs* e);
    static HybridDictionary* EnsureInstanceData(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, InstanceStyleData::Enum dataType) { return EnsureInstanceData(pDataField,pContainer,dataType,-1); }
    static HybridDictionary* EnsureInstanceData(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, InstanceStyleData::Enum dataType, int initialSize);
    static DependencyObject* GetChild(ItemStructList< TRefCountedPtr<DependencyObject> >* pStyledChildren, int childIndex);
    static DependencyObject* GetChild(DependencyObject* pContainer, int childIndex);
    static int QueryChildIndexFromChildName(String* pChildName, HybridDictionary* pChildIndexFromChildName);
    static void InvokeApplicableDataTriggerActions(Style* pStyle, FrameworkTemplate* pFrameworkTemplate, DependencyObject* pContainer, BindingBase* pBinding, BindingValueChangedEventArgs* e, UncommonField<HybridDictionaryArray>* pDataField);
    static void InvokeDataTriggerActions(TriggerBase* pTriggerBase, DependencyObject* pTriggerContainer, BindingBase* pBinding, BindingValueChangedEventArgs* pBindingChangedArgs, Style* pStyle, FrameworkTemplate* pFrameworkTemplate, UncommonField<HybridDictionaryArray>* pDataField);
    static bool IsStylingLogicalTree(DependencyProperty* pDP, Object* pValue);
    static bool RequiresInstanceStorage(TRefCountedPtr<Object>* ppValue);
    static void AddResourceDependent(int childIndex, DependencyProperty* pDP, Object* pName, ItemStructList<ChildPropertyDependent>* pResourceDependents);
    static void AddPropertyTriggerWithAction(TriggerBase* pTriggerBase, DependencyProperty* pProperty, FrugalMap* pTriggersWithActions);
    static void ProcessEventTrigger(EventTrigger* pEventTrigger, HybridDictionary* pChildIndexFromChildName, TRefCountedPtr<HybridDictionary>* ppTriggerActions, ItemStructList<ChildEventDependent>* pEventDependents, FrameworkElementFactory* pTemplateRoot, FrameworkTemplate* pFrameworkTemplate, TRefCountedPtr<EventHandlersStore>* ppEventHandlersStore, bool* pHasLoadedChangeHandler);
    static RoutedEventHandler* get_EventTriggerHandlerOnContainer();
    static RoutedEventHandler* get_EventTriggerHandlerOnChild();
    static void UpdateTemplateCache(FrameworkElement* pFE, FrameworkTemplate* pOldTemplate, FrameworkTemplate* pNewTemplate, DependencyProperty* pTemplateProperty);
    static void DoTemplateInvalidations(FrameworkElement* pFEContainer, FrameworkTemplate* pOldFrameworkTemplate);
    static void UpdateLoadedFlag(DependencyObject* pDO, FrameworkTemplate* pOldFrameworkTemplate, FrameworkTemplate* pNewFrameworkTemplate);
    static void UpdateLoadedFlag(DependencyObject* pDO, Style* pOldStyle, Style* pNewStyle);
    static void ClearGeneratedSubTree(HybridDictionaryArray* pInstanceData, FrameworkElement* pFEContainer, FrameworkContentElement* pFCEContainer, FrameworkTemplate* pOldFrameworkTemplate);
    static void DetachGeneratedSubTree(FrameworkElement* pFEContainer, FrameworkContentElement* pFCEContainer);
    static bool IsSetOnContainer(DependencyProperty* pDP, ItemStructList<ContainerDependent>* pContainerDependents, bool alsoFromTriggers);
    static void ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty* pDP);
    static void UpdateInstanceData(UncommonField<HybridDictionaryArray>* pDataField, FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldStyle, Style* pNewStyle, FrameworkTemplate* pOldFrameworkTemplate, FrameworkTemplate* pNewFrameworkTemplate, InternalFlags::Enum hasGeneratedSubTreeFlag);
    static void CreateInstanceData(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pNewStyle, FrameworkTemplate* pNewFrameworkTemplate);
    static void ProcessInstanceValuesForChild(DependencyObject* pContainer, DependencyObject* pChild, int childIndex, HybridDictionary* pInstanceValues, bool apply, ItemStructList<ChildRecord>* pChildRecordFromChildIndex);
    static void ProcessInstanceValuesHelper(ItemStructList<ChildValueLookup>* pValueLookupList, DependencyObject* pTarget, int childIndex, HybridDictionary* pInstanceValues, bool apply);
    static void ProcessInstanceValue(DependencyObject* pTarget, int childIndex, HybridDictionary* pInstanceValues, DependencyProperty* pDP, int i, bool apply);
    static void ReleaseInstanceData(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldStyle, FrameworkTemplate* pOldFrameworkTemplate, InternalFlags::Enum hasGeneratedSubTreeFlag);
    static Object* get_NotYetApplied() { static Object notYetApplied; return &notYetApplied; }
    static void ReleaseInstanceDataForDataTriggers(UncommonField<HybridDictionaryArray>* pDataField, HybridDictionary* pInstanceValues, Style* pOldStyle, FrameworkTemplate* pOldFrameworkTemplate);
    static void ReleaseInstanceDataForTriggerBinding(BindingBase* pBinding, HybridDictionary* pInstanceValues, Delegate* pHandler);
    static void ClearTemplateChain(HybridDictionaryArray* pInstanceData, FrameworkElement* pFEContainer, FrameworkContentElement* pFCEContainer, ItemStructList< TRefCountedPtr<DependencyObject> >* pTemplateChain, FrameworkTemplate* pOldFrameworkTemplate);
    static void DoStyleResourcesInvalidations(DependencyObject* pContainer, FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldStyle, Style* pNewStyle);
    static TRefCountedPtr<ResourceDictionaryList> GetResourceDictionariesFromStyle(Style* pStyle);
    static void DoTemplateResourcesInvalidations(DependencyObject* pContainer, FrameworkElement* pFE, FrameworkContentElement* pFCE, Object* pOldTemplate, Object* pNewTemplate);
    static void DoThemeStyleInvalidations(FrameworkElement* pFE, FrameworkContentElement* pFCE, Style* pOldThemeStyle, Style* pNewThemeStyle, Style* pStyle);
    static TRefCountedPtr<ResourceDictionaryList> GetResourceDictionariesFromTemplate(Object* pTemplate);
    static void SetShouldLookupImplicitStyles(FrameworkObject fo, ResourceDictionaryList* pDictionaries);
    static void SpecialDowncastToFEorFCE(DependencyObject* pDO, FrameworkElement** ppFe, FrameworkContentElement** ppFce, bool throwIfNeither);
    static void DeferActions(TriggerBase* pTriggerBase, DependencyObject* pTriggerContainer, TriggerActionCollection* pActions, Style* pStyle, FrameworkTemplate* pFrameworkTemplate);
    static bool CanInvokeActionsNow(DependencyObject* pContainer, FrameworkTemplate* pFrameworkTemplate);
    static bool HasResourceDependentsForChild(int childIndex, ItemStructList<ChildPropertyDependent>* pResourceDependents);
    static int CreateChildIndexFromChildName(String* pChildName, FrameworkTemplate* pFrameworkTemplate);
    static void CreateInstanceDataForChild(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, DependencyObject* pChild, int childIndex, bool hasInstanceValues, ItemStructList<ChildRecord>* pChildRecordFromChildIndex);
    static void SealTemplate(FrameworkTemplate* pFrameworkTemplate, bool* pIsSealed, FrameworkElementFactory* pTemplateRoot, TriggerCollection* pTriggers, ResourceDictionary* pResources, HybridDictionary* pChildIndexFromChildID, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, ItemStructList< ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, ItemStructList<ContainerDependent>* pContainerDependents, ItemStructList<ChildPropertyDependent>* pResourceDependents, ItemStructList<ChildEventDependent>* pEventDependents, TRefCountedPtr<HybridDictionary>* ppTriggerActions, TRefCountedPtr<HybridDictionary>* ppDataTriggerRecordFromBinding, bool* pHasInstanceValues, TRefCountedPtr<EventHandlersStore>* ppEventHandlersStore);
    static void ProcessTemplateContentFromFEF(FrameworkElementFactory* pFactory, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, ItemStructList< ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, ItemStructList<ChildPropertyDependent>* pResourceDependents, ItemStructList<ChildEventDependent>* pEventDependents, TRefCountedPtr<HybridDictionary>* ppDataTriggerRecordFromBinding, HybridDictionary* pChildIndexFromChildID, bool* pHasInstanceValues);
    static void ProcessTemplateContent(FrameworkTemplate* pFrameworkTemplate, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, ItemStructList< ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, ItemStructList<ChildPropertyDependent>* pResourceDependents, ItemStructList<ChildEventDependent>* pEventDependents, TRefCountedPtr<HybridDictionary>* ppDataTriggerRecordFromBinding, HybridDictionary* pChildIndexFromChildID, bool* pHasInstanceValues);
    static void StyleHelper::ProcessTemplateTriggers(TriggerCollection* pTriggers, FrameworkTemplate* pFrameworkTemplate, ItemStructList<ChildRecord>* pChildRecordFromChildIndex, 
                                                      ItemStructList< ItemStructMap<TriggerSourceRecord> >* pTriggerSourceRecordFromChildIndex, ItemStructList<ContainerDependent>* pContainerDependents, 
                                                      ItemStructList<ChildPropertyDependent>* pResourceDependents, ItemStructList<ChildEventDependent>* pEventDependents, 
                                                      TRefCountedPtr<HybridDictionary>* ppDataTriggerRecordFromBinding, HybridDictionary* pChildIndexFromChildID, 
                                                      bool* pHasInstanceValues, TRefCountedPtr<HybridDictionary>* ppTriggerActions, FrameworkElementFactory* pTemplateRoot, TRefCountedPtr<EventHandlersStore>* ppEventHandlersStore, 
                                                      FrugalMap* pPropertyTriggersWithActions, TRefCountedPtr<HybridDictionary>* ppDataTriggersWithActions, bool* pHasLoadedChangeHandler);
    static void DetermineTriggerType(TriggerBase* pTriggerBase, Trigger** ppTrigger, MultiTrigger** ppMultiTrigger, DataTrigger** ppDataTrigger, MultiDataTrigger** ppMultiDataTrigger, EventTrigger** ppEventTrigger);
    static bool ApplyTemplateContent(UncommonField<HybridDictionaryArray>* pDataField, DependencyObject* pContainer, FrameworkElementFactory* pTemplateRoot, int lastChildIndex, HybridDictionary* pChildIndexFromChildID, FrameworkTemplate* pFrameworkTemplate);
    static void CheckForCircularReferencesInTemplateTree(DependencyObject* pContainer, FrameworkTemplate* pFrameworkTemplate);

    static UncommonField<ItemStructList<TRefCountedPtr<DependencyObject> > > TemplatedFeChildrenField;
    static UncommonField<HybridDictionary> TemplatedNonFeChildrenField;
    static TRefCountedPtr<RoutedEventHandler> ms_pEventTriggerHandlerOnContainer;
    static UncommonField<HybridDictionaryArray> TemplateDataField;
    static UncommonField<HybridDictionaryArray> StyleDataField;
    static UncommonField<HybridDictionaryArray> ThemeStyleDataField;
    static UncommonField<HybridDictionary> ParentTemplateValuesField;
};

}; // namespace AVUI
